package table

import (
	"epg-mc/database/table/config"

	"github.com/jinzhu/gorm"
)

//AutoMigrate database
func AutoMigrate(db *gorm.DB) {
	//config table.
	db.AutoMigrate(&config.Config{})
	_conf := &config.Config{}
	db.First(_conf, "key = ?", config.SiteTitle)
	if _conf.ID == 0 {
		db.Create(&config.Config{ID: 1, Group: "sys", Key: config.SiteTitle, Value: "EPG Connection Pool Cluster Manager", Comment: "site title"})
	}

	//other table.
}
